module.exports = (req, res, next) => {
    let username = req.session.username;
    // console.log(username);
    if(username){
        next();
    }else{
        // res.redirect('/login')
        res.json({
            code:304,
            message:"抱歉，您未登录"
        })
    }
    // let { key } = req.query;
    // if (key) {
    //     next();
    // } else {
    //     res.json({
    //         code: 304,
    //         message: "抱歉，您未登录"
    //     })
    // }
}